Integrand size = 32, antiderivative size = 76 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {C \text {arctanh}(\sin (c+d x))}{b d}+\frac {2 (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b} d} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {4135, 3855, 12, 3916, 2738, 214} \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {2 (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b d \sqrt {a-b} \sqrt {a+b}}+\frac {C \text {arctanh}(\sin (c+d x))}{b d} \]
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 3855
Rule 3916
Rule 4135
Rubi steps \begin{align*} \text {integral}& = \frac {\int \frac {(b B-a C) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b}+\frac {C \int \sec (c+d x) \, dx}{b} \\ & = \frac {C \text {arctanh}(\sin (c+d x))}{b d}+\frac {(b B-a C) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b} \\ & = \frac {C \text {arctanh}(\sin (c+d x))}{b d}+\frac {(b B-a C) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b^2} \\ & = \frac {C \text {arctanh}(\sin (c+d x))}{b d}+\frac {(2 (b B-a C)) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^2 d} \\ & = \frac {C \text {arctanh}(\sin (c+d x))}{b d}+\frac {2 (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b} d} \\ \end{align*}
Time = 0.38 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.47 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\frac {2 (-b B+a C) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+C \left (-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )}{b d} \]
[In]
[Out]
Time = 0.27 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.21
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (-B b +C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}-\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}}{d}\) | \(92\) |
default | \(\frac {-\frac {2 \left (-B b +C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}-\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}}{d}\) | \(92\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C a}{\sqrt {a^{2}-b^{2}}\, d b}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C a}{\sqrt {a^{2}-b^{2}}\, d b}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d b}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d b}\) | \(331\) |
[In]
[Out]
none
Time = 0.61 (sec) , antiderivative size = 316, normalized size of antiderivative = 4.16 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\left [-\frac {{\left (C a - B b\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - {\left (C a^{2} - C b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (C a^{2} - C b^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, {\left (a^{2} b - b^{3}\right )} d}, -\frac {2 \, {\left (C a - B b\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (C a^{2} - C b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (C a^{2} - C b^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, {\left (a^{2} b - b^{3}\right )} d}\right ] \]
[In]
[Out]
\[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.68 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b} - \frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b} - \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (C a - B b\right )}}{\sqrt {-a^{2} + b^{2}} b}}{d} \]
[In]
[Out]
Time = 18.76 (sec) , antiderivative size = 573, normalized size of antiderivative = 7.54 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {B\,a^2\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,{\left (a^2-b^2\right )}^{3/2}}-\frac {B\,\ln \left (\frac {a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}}{d\,\left (a^2-b^2\right )}-\frac {2\,C\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^2-b^2\right )}-\frac {B\,b^2\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {2\,C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b\,d\,\left (a^2-b^2\right )}-\frac {C\,a^3\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b\,d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {C\,a\,b\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {C\,a\,\ln \left (\frac {a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}}{b\,d\,\left (a^2-b^2\right )} \]
[In]
[Out]